home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / biblio / bibtex / contrib / automatica.bst < prev    next >
Text File  |  1993-08-02  |  24KB  |  1,281 lines

  1. % BibTeX standard bibliography style `IFACh' (one of the harvard family)
  2.     % version 0.99a for BibTeX versions 0.99a or later, LaTeX version 2.09.
  3.     % Copyright (C) 1991, all rights reserved.
  4.     % Copying of this file is authorized only if either
  5.     % (1) you make absolutely no changes to your copy, including name, or
  6.     % (2) if you do make changes, you name it something other than
  7.     % btxbst.doc, plain.bst, unsrt.bst, alpha.bst, abbrv.bst, agsm.bst,
  8.         % dcu.bst or kluwer.bst.
  9.     % This restriction helps ensure that all standard styles are identical.
  10.     % The file harvard.tex has the documentation for this style.
  11.  
  12. % ACKNOWLEDGEMENT:
  13. %   This document is a modified version of agsm.bst by
  14. %   Peter Williams, Key Centre for Design Quality, Sydney University
  15. %   e-mail: peterw@archsci.arch.su.oz.au
  16. % AUTHOR:
  17. %   Silvano Balemi, Automatic Control Laboratory, ETH Zurich
  18. %   e-mail: balemi@aut.ethz.ch
  19.  
  20. ENTRY
  21.   { address
  22.     author
  23.     booktitle
  24.     chapter
  25.     edition
  26.     editor
  27.     howpublished
  28.     institution
  29.     journal
  30.     key
  31.     month
  32.     note
  33.     number
  34.     organization
  35.     pages
  36.     publisher
  37.     school
  38.     series
  39.     title
  40.     type
  41.     volume
  42.     year
  43.   }
  44.   { field.used }
  45.   { extra.label sort.label list.year }
  46.  
  47. INTEGERS { output.state before.all mid.sentence after.sentence after.block }
  48.  
  49. FUNCTION {init.state.consts}
  50. { #0 'before.all :=
  51.   #1 'mid.sentence :=
  52.   #2 'after.sentence :=
  53.   #3 'after.block :=
  54. }
  55.  
  56. STRINGS { s t f }
  57.  
  58. FUNCTION {output.nonnull}
  59. { 's :=
  60.   output.state mid.sentence =
  61.     { ". " * write$ }
  62.     { output.state after.block =
  63.     { add.period$ write$
  64.       newline$
  65.       "\newblock " write$
  66.     }
  67.     { output.state before.all =
  68.         'write$
  69.         { add.period$ " " * write$ }
  70.       if$
  71.     }
  72.       if$
  73.       mid.sentence 'output.state :=
  74.     }
  75.   if$
  76.   s
  77. }
  78.  
  79. FUNCTION {output.yearnull}
  80. { 's :=
  81.   output.state mid.sentence =
  82.     { ". " * write$ }
  83.     { output.state after.block =
  84.     { add.period$ write$
  85.       newline$
  86.       "\newblock " write$
  87.     }
  88.     { output.state before.all =
  89.         'write$
  90.         { add.period$ " " * write$ }
  91.       if$
  92.     }
  93.       if$
  94.       mid.sentence 'output.state :=
  95.     }
  96.   if$
  97.   s
  98. }
  99.  
  100. FUNCTION {output}
  101. { duplicate$ empty$
  102.     'pop$
  103.     'output.nonnull
  104.   if$
  105. }
  106.  
  107. FUNCTION {output.check}
  108. { 't :=
  109.   duplicate$ empty$
  110.     { pop$ "empty " t * " in " * cite$ * warning$ }
  111.     'output.nonnull
  112.   if$
  113. }
  114.  
  115. FUNCTION {item.check}
  116. { 't :=
  117.   empty$
  118.     { "empty " t * " in " * cite$ * warning$ }
  119.     { skip$ }
  120.   if$
  121. }
  122.  
  123. FUNCTION {fin.entry}
  124. { add.period$
  125.   write$
  126.   newline$
  127. }
  128.  
  129. FUNCTION {new.block}
  130. { output.state before.all =
  131.     'skip$
  132.     { after.block 'output.state := }
  133.   if$
  134. }
  135.  
  136. FUNCTION {not}
  137. {   { #0 }
  138.     { #1 }
  139.   if$
  140. }
  141.  
  142. FUNCTION {and}
  143. {   'skip$
  144.     { pop$ #0 }
  145.   if$
  146. }
  147.  
  148. FUNCTION {or}
  149. {   { pop$ #1 }
  150.     'skip$
  151.   if$
  152. }
  153.  
  154. FUNCTION {field.or.null}
  155. { duplicate$ empty$
  156.     { pop$ "" }
  157.     'skip$
  158.   if$
  159. }
  160.  
  161. FUNCTION {emphasize}
  162. { duplicate$ empty$
  163.     { pop$ "" }
  164.     { "{\em " swap$ * "}" * }
  165.   if$
  166. }
  167.  
  168. FUNCTION {embolden}
  169. { duplicate$ empty$
  170.     { pop$ "" }
  171.     { "{\bf " swap$ * "}" * }
  172.   if$
  173. }
  174.  
  175. FUNCTION {quote}
  176. { duplicate$ empty$
  177.     { pop$ "" }
  178.     { "`" swap$ * "'" * }
  179.   if$
  180. }
  181.  
  182. INTEGERS { nameptr namesleft numnames }
  183.  
  184. FUNCTION {format.names}
  185. { 's :=
  186.   #1 'nameptr :=
  187.   s num.names$ 'numnames :=
  188.   numnames 'namesleft :=
  189.     { namesleft #0 > }
  190. %    { s nameptr "{ff~}{vv~}{ll}{, jj}" format.name$ 't :=
  191.     { s nameptr "{vv~}{ll}{, jj}{, f.}" format.name$ 't :=
  192.       nameptr #1 >
  193.     { namesleft #1 >
  194.             s nameptr "{ff~}{vv~}{ll}{, jj}" format.name$ 't :=
  195.     { ", " * t * }
  196.         { numnames #2 >
  197.         { "" * }
  198.         'skip$
  199.           if$
  200.           t "others" =
  201.         { " et~al." * }
  202.         { " and " * t * }
  203.           if$
  204.         }
  205.       if$
  206.     }
  207.     't
  208.       if$
  209.       nameptr #1 + 'nameptr :=
  210.       namesleft #1 - 'namesleft :=
  211.     }
  212.   while$
  213. }
  214.  
  215. FUNCTION {format.authors}
  216. { author empty$
  217.     { "" }
  218.     { author format.names }
  219.   if$
  220. }
  221.  
  222.  
  223. FUNCTION {format.editor.names}
  224. { 's :=
  225.   'f :=
  226.   #1 'nameptr :=
  227.   s num.names$ 'numnames :=
  228.   numnames 'namesleft :=
  229.     { namesleft #0 > }
  230.     { s nameptr f format.name$ 't :=
  231.       nameptr #1 >
  232.     { namesleft #1 >
  233.         { ", " * t * }
  234.         { t "others" =
  235.         { " et~al." * }
  236.         { " and " * t * }
  237.           if$
  238.         }
  239.       if$
  240.     }
  241.     't
  242.       if$
  243.       nameptr #1 + 'nameptr :=
  244.       namesleft #1 - 'namesleft :=
  245.     }
  246.   while$
  247. }
  248.  
  249. FUNCTION {format.editors}
  250. { editor empty$
  251.     { "" }
  252.     { "{vv~}{ll}{, jj}{, f.}" editor format.editor.names
  253.       editor num.names$ #1 >
  254.     { " (Eds.)" * }
  255.     { " (Ed.)" * }
  256.       if$
  257.     }
  258.   if$
  259. }
  260.  
  261. FUNCTION {format.editors.reverse}
  262. { editor empty$
  263.     { "" }
  264.     { "{f.~}{vv~}{ll}{, jj}" editor format.editor.names
  265.       editor num.names$ #1 >
  266.     { " (Eds.)" * }
  267.     { " (Ed.)" * }
  268.       if$
  269.     }
  270.   if$
  271. }
  272.  
  273.  
  274. FUNCTION {format.title}
  275. { title empty$
  276.     { "" }
  277.     { title "t" change.case$ }
  278.   if$
  279. }
  280.  
  281. FUNCTION {n.dashify}
  282. { 't :=
  283.   ""
  284.     { t empty$ not }
  285.     { t #1 #1 substring$ "-" =
  286.     { t #1 #2 substring$ "--" = not
  287.         { "--" *
  288.           t #2 global.max$ substring$ 't :=
  289.         }
  290.         {   { t #1 #1 substring$ "-" = }
  291.         { "-" *
  292.           t #2 global.max$ substring$ 't :=
  293.         }
  294.           while$
  295.         }
  296.       if$
  297.     }
  298.     { t #1 #1 substring$ *
  299.       t #2 global.max$ substring$ 't :=
  300.     }
  301.       if$
  302.     }
  303.   while$
  304. }
  305.  
  306. FUNCTION {format.btitle}
  307. { title emphasize
  308. }
  309.  
  310. FUNCTION {tie.or.space.connect}
  311. { duplicate$ text.length$ #3 <
  312.     { "~" }
  313.     { " " }
  314.   if$
  315.   swap$ * *
  316. }
  317.  
  318. FUNCTION {either.or.check}
  319. { empty$
  320.     'pop$
  321.     { "can't use both " swap$ * " fields in " * cite$ * warning$ }
  322.   if$
  323. }
  324.  
  325. FUNCTION {format.bvolume}
  326. { volume empty$
  327.     { "" }
  328.     { "Vol." volume tie.or.space.connect
  329.       series empty$
  330.     'skip$
  331.     { " of " * series emphasize * }
  332.       if$
  333.       "volume and number" number either.or.check
  334.     }
  335.   if$
  336. }
  337.  
  338. FUNCTION {format.number.series}
  339. { volume empty$
  340.     { number empty$
  341.     { series field.or.null }
  342.     { output.state mid.sentence =
  343.         { "number" }
  344.         { "Number" }
  345.       if$
  346.       number tie.or.space.connect
  347.       series empty$
  348.         { "there's a number but no series in " cite$ * warning$ }
  349.         { " In " * series quote * }
  350.       if$
  351.     }
  352.       if$
  353.     }
  354.     { "" }
  355.   if$
  356. }
  357.  
  358. FUNCTION {format.edition}
  359. { edition empty$
  360.     { "" }
  361.     { output.state mid.sentence =
  362.     { edition "l" change.case$ " edn" * }
  363.     { edition "t" change.case$ " edn" * }
  364.       if$
  365.     }
  366.   if$
  367. }
  368.  
  369. INTEGERS { multiresult }
  370.  
  371. FUNCTION {multi.page.check}
  372. { 't :=
  373.   #0 'multiresult :=
  374.     { multiresult not
  375.       t empty$ not
  376.       and
  377.     }
  378.     { t #1 #1 substring$
  379.       duplicate$ "-" =
  380.       swap$ duplicate$ "," =
  381.       swap$ "+" =
  382.       or or
  383.     { #1 'multiresult := }
  384.     { t #2 global.max$ substring$ 't := }
  385.       if$
  386.     }
  387.   while$
  388.   multiresult
  389. }
  390.  
  391. FUNCTION {format.pages}
  392. { pages empty$
  393.     { "" }
  394.     { pages multi.page.check
  395.     { "pp.~" pages n.dashify * }
  396.     { "p.~" pages * }
  397.       if$
  398.     }
  399.   if$
  400. }
  401.  
  402. FUNCTION {format.vol.num.pages}
  403. { volume embolden field.or.null
  404.   number empty$
  405.     'skip$
  406.     { "(" number * ")" * *
  407.       volume empty$
  408.     { "there's a number but no volume in " cite$ * warning$ }
  409.     'skip$
  410.       if$
  411.     }
  412.   if$
  413.   pages empty$
  414.     'skip$
  415.     { duplicate$ empty$
  416.     { pop$ format.pages }
  417.     { ",~" * pages n.dashify * }
  418.       if$
  419.     }
  420.   if$
  421. }
  422.  
  423. FUNCTION {format.chapter.pages}
  424. { chapter empty$
  425.     'format.pages
  426.     { type empty$
  427.     { "chapter" }
  428.     { type "l" change.case$ }
  429.       if$
  430.       chapter tie.or.space.connect
  431.       pages empty$
  432.     'skip$
  433.     { ", " * format.pages * }
  434.       if$
  435.     }
  436.   if$
  437. }
  438.  
  439. FUNCTION {format.in.ed.booktitle}
  440. { booktitle empty$
  441.     { "" }
  442.     { editor empty$
  443.     { "In " booktitle quote * }
  444.     { "In " format.editors.reverse * ". " * booktitle quote * }
  445.       if$
  446.     }
  447.   if$
  448. }
  449.  
  450. FUNCTION {empty.misc.check}
  451. { author empty$ title empty$ howpublished empty$
  452.   month empty$ year empty$ note empty$
  453.   and and and and and
  454.   key empty$ not and
  455.     { "all relevant fields are empty in " cite$ * warning$ }
  456.     'skip$
  457.   if$
  458. }
  459.  
  460. FUNCTION {format.thesis.type}
  461. { type empty$
  462.     'skip$
  463.     { pop$
  464.       type "t" change.case$
  465.     }
  466.   if$
  467. }
  468.  
  469. FUNCTION {format.tr.number}
  470. { type empty$
  471.     { "Technical Report" }
  472.     'type
  473.   if$
  474.   number empty$
  475.     { "t" change.case$ }
  476.     { number tie.or.space.connect }
  477.   if$
  478. }
  479.  
  480. FUNCTION {format.article.crossref}
  481. { key empty$
  482.     { journal empty$
  483.     { "need key or journal for " cite$ * " to crossref " * crossref *
  484.       warning$
  485.       ""
  486.     }
  487.     { "in {\em " journal * "\/} \cite{" * crossref * "}" *}
  488.       if$
  489.     }
  490.     { "In \citeasnoun{" crossref * "}" * }
  491.   if$
  492.  
  493. }
  494.  
  495. FUNCTION {format.book.crossref}
  496. { volume empty$
  497.     { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
  498.       "in "
  499.     }
  500.     { "Vol." volume tie.or.space.connect
  501.       " of " *
  502.     }
  503.   if$
  504.   editor empty$
  505.   editor field.or.null author field.or.null =
  506.   or
  507.     { key empty$
  508.     { series empty$
  509.         { "need editor, key, or series for " cite$ * " to crossref " *
  510.           crossref * warning$
  511.           "" *
  512.         }
  513.         { "{\em " * series * "\/} \cite{" * crossref * "}" *}
  514.       if$
  515.     }
  516.     { " \citeasnoun{" * crossref * "}" * }
  517.       if$
  518.     }
  519.     { " \citeasnoun{" * crossref * "}" * }
  520.   if$
  521. }
  522.  
  523. FUNCTION {format.incoll.inproc.crossref}
  524. { editor empty$
  525.   editor field.or.null author field.or.null =
  526.   or
  527.     { key empty$
  528.     { booktitle empty$
  529.         { "need editor, key, or booktitle for " cite$ * " to crossref " *
  530.           crossref * warning$
  531.           ""
  532.         }
  533.         { "in {\em " booktitle * "\/}" * " \cite{" * crossref * "}" *}
  534.       if$
  535.     }
  536.     { "In \citeasnoun{" crossref * "}" * }
  537.       if$
  538.     }
  539.     { "In \citeasnoun{" crossref * "}" * }
  540.   if$
  541.   
  542. }
  543.  
  544. INTEGERS { len }
  545.  
  546. FUNCTION {chop.word}
  547. { 's :=
  548.   'len :=
  549.   s #1 len substring$ =
  550.     { s len #1 + global.max$ substring$ }
  551.     's
  552.   if$
  553. }
  554.  
  555. FUNCTION {format.lab.names.abbr}
  556. { 's :=
  557.   s num.names$ 'numnames :=
  558.   numnames #1 >
  559.     { numnames #2 >
  560.     { s #1 "{vv~}{ll}" format.name$ " {\em et al.}" * }
  561.     { s #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
  562.             { s #1 "{vv~}{ll}" format.name$ " {\em et al.}" * }
  563.         { s #1 "{vv~}{ll}" format.name$ " and " *
  564.               s #2 "{vv~}{ll}" format.name$ * 
  565.             }
  566.           if$
  567.         }
  568.       if$
  569.     }
  570.     { s #1 "{vv~}{ll}" format.name$ }
  571.   if$
  572. }
  573.  
  574. FUNCTION {format.lab.names.full}
  575. { 's :=
  576.   #1 'nameptr :=
  577.   s num.names$ 'numnames :=
  578.   numnames 'namesleft :=
  579.     { namesleft #0 > }
  580.     { s nameptr "{vv~}{ll}" format.name$ 't :=
  581.       nameptr #1 >
  582.     { namesleft #1 >
  583.         { ", " * t * }
  584.         { t "others" =
  585.         { " et~al." * }
  586.         { " and " * t * }
  587.           if$
  588.         }
  589.       if$
  590.     }
  591.     't
  592.       if$
  593.       nameptr #1 + 'nameptr :=
  594.       namesleft #1 - 'namesleft :=
  595.     }
  596.   while$
  597. }
  598.  
  599. INTEGERS { author.field editor.field organization.field title.field key.field }
  600.  
  601. FUNCTION {init.field.constants}
  602. { #0 'author.field :=
  603.   #1 'editor.field :=
  604.   #2 'organization.field :=
  605.   #3 'title.field :=
  606.   #4 'key.field :=
  607. }
  608.  
  609. FUNCTION {make.list.label}
  610. { author.field field.used =
  611.     { format.authors }
  612.     { editor.field field.used =
  613.         { format.editors }
  614.         { organization.field field.used =
  615.             { "The " #4 organization chop.word #3 text.prefix$ }
  616.             { title.field field.used =
  617.                 { format.btitle }
  618.                 { key.field field.used =
  619.                     { key #3 text.prefix$ }
  620.                     { "Internal error :001 on " cite$ * " label" * warning$ }
  621.                   if$
  622.                 }
  623.               if$
  624.             }
  625.           if$
  626.         }
  627.       if$
  628.     }
  629.   if$
  630. }
  631.  
  632. FUNCTION {make.full.label}
  633. { author.field field.used =
  634.     { author format.lab.names.full }
  635.     { editor.field field.used =
  636.         { editor format.lab.names.full }
  637.         { organization.field field.used =
  638.             { "The " #4 organization chop.word #3 text.prefix$ }
  639.             { title.field field.used =
  640.                 { format.btitle }
  641.                 { key.field field.used =
  642.                     { key #3 text.prefix$ }
  643.                     { "Internal error :001 on " cite$ * " label" * warning$ }
  644.                   if$
  645.                 }
  646.               if$
  647.             }
  648.           if$
  649.         }
  650.       if$
  651.     }
  652.   if$
  653. }
  654.  
  655. FUNCTION {make.abbr.label}
  656. { author.field field.used =
  657.     { author format.lab.names.abbr }
  658.     { editor.field field.used =
  659.         { editor format.lab.names.abbr }
  660.         { organization.field field.used =
  661.             { "The " #4 organization chop.word #3 text.prefix$ }
  662.             { title.field field.used =
  663.                 { format.btitle }
  664.                 { key.field field.used =
  665.                     { key #3 text.prefix$ }
  666.                     { "Internal error :001 on " cite$ * " label" * warning$ }
  667.                   if$
  668.                 }
  669.               if$
  670.             }
  671.           if$
  672.         }
  673.       if$
  674.     }
  675.   if$
  676. }
  677.  
  678. FUNCTION {output.bibitem}
  679. { newline$
  680.   "\harvarditem[" write$
  681.   make.abbr.label write$
  682.   "]{" write$
  683.   make.abbr.label write$
  684.   "}{" write$
  685.   list.year write$
  686.   "}{" write$
  687.   cite$ write$
  688.   "}" write$
  689.   newline$
  690.   ""
  691.   before.all 'output.state :=
  692. }
  693.  
  694. FUNCTION {list.label.output}
  695. { make.list.label " " * write$
  696. }
  697.  
  698. FUNCTION {article}
  699. { output.bibitem
  700.   list.label.output
  701.   " (" list.year * ")" * output.yearnull
  702.   author "author" item.check
  703.   title.field field.used =
  704.     { skip$ }
  705.     { format.title quote "title" output.check }
  706.   if$
  707.   crossref missing$
  708.     { journal emphasize "journal" duplicate$ item.check
  709.       pages empty$
  710.         {
  711.           output
  712.         }
  713.         {
  714.           " " *
  715.           format.vol.num.pages * output
  716.         }
  717.       if$
  718.     }
  719.     { format.article.crossref output.nonnull
  720.       format.pages output
  721.     }
  722.   if$
  723.   new.block
  724.   note output
  725.   fin.entry
  726. }
  727.  
  728. FUNCTION {book}
  729. { output.bibitem
  730.   list.label.output
  731.   " (" list.year * ")" * output.yearnull
  732.   author empty$
  733.     { editor "author and editor" item.check }
  734.     { crossref missing$
  735.     { "author and editor" editor either.or.check }
  736.     'skip$
  737.       if$
  738.     }
  739.   if$
  740.   title.field field.used =
  741.     { skip$ }
  742.     { format.btitle "title" output.check }
  743.   if$
  744.   crossref missing$
  745.     { format.bvolume output
  746.       format.number.series output
  747.       format.edition output
  748.       publisher "publisher" output.check
  749.       address output
  750.     }
  751.     { format.book.crossref output.nonnull
  752.       format.edition output
  753.     }
  754.   if$
  755.   new.block
  756.   note output
  757.   fin.entry
  758. }
  759.  
  760. FUNCTION {booklet}
  761. { output.bibitem
  762.   list.label.output
  763.   " (" list.year * ")" * output.yearnull
  764.   title.field field.used =
  765.     { skip$ }
  766.     { format.title quote "title" output.check }
  767.   if$
  768.   howpublished output
  769.   address output
  770.   new.block
  771.   note output
  772.   fin.entry
  773. }
  774.  
  775. FUNCTION {inbook}
  776. { output.bibitem
  777.   list.label.output
  778.   " (" list.year * ")" * output.yearnull
  779.   author empty$
  780.     { editor "author and editor" item.check }
  781.     { crossref missing$
  782.     { "author and editor" editor either.or.check }
  783.     'skip$
  784.       if$
  785.     }
  786.   if$
  787.   title.field field.used =
  788.     { skip$ }
  789.     { format.btitle "title" output.check }
  790.   if$
  791.   crossref missing$
  792.     { format.bvolume output
  793.       format.number.series output
  794.       format.edition output
  795.       publisher "publisher" output.check
  796.       address output
  797.     }
  798.     { format.book.crossref output.nonnull
  799.       format.edition output
  800.     }
  801.   if$
  802.   format.chapter.pages "chapter and pages" output.check
  803.   new.block
  804.   note output
  805.   fin.entry
  806. }
  807.  
  808. FUNCTION {incollection}
  809. { output.bibitem
  810.   list.label.output
  811.   " (" list.year * ")" * output.yearnull
  812.   title.field field.used =
  813.     { skip$ }
  814.     { format.title "title" output.check }
  815.   if$
  816.   author "author" item.check
  817.   crossref missing$
  818.     { format.in.ed.booktitle "booktitle" output.check
  819.       format.edition output
  820.       format.bvolume output
  821.       format.number.series output
  822.       publisher "publisher" output.check
  823.       address output
  824.     }
  825.     { format.incoll.inproc.crossref output.nonnull
  826.     }
  827.   if$
  828.   format.chapter.pages output
  829.   new.block
  830.   note output
  831.   fin.entry
  832. }
  833.  
  834. FUNCTION {inproceedings}
  835. { output.bibitem
  836.   list.label.output
  837.   " (" list.year * ")" * output.yearnull
  838.   title.field field.used =
  839.     { skip$ }
  840.     { format.title "title" output.check }
  841.   if$
  842.   author "author" item.check
  843.   crossref missing$
  844.     { format.in.ed.booktitle "booktitle" output.check
  845.       format.bvolume output
  846.       format.number.series output
  847.       address empty$
  848.     { organization output
  849.       publisher output
  850.     }
  851.     { organization output
  852.       publisher output
  853.           address output.nonnull
  854.      }
  855.       if$
  856.     }
  857.     { format.incoll.inproc.crossref output.nonnull
  858.     }
  859.   if$
  860.   format.pages output
  861.   new.block
  862.   note output
  863.   fin.entry
  864. }
  865.  
  866. FUNCTION {conference} { inproceedings }
  867.  
  868. FUNCTION {manual}
  869. { output.bibitem
  870.   list.label.output
  871.   " (" list.year * ")" * output.yearnull
  872.   title.field field.used =
  873.     { skip$ }
  874.     { format.btitle "title" output.check }
  875.   if$
  876.   format.edition output
  877.   author empty$
  878.     { organization empty$
  879.     { address output }
  880.     'skip$
  881.       if$
  882.     }
  883.     { organization output
  884.       address output
  885.     }
  886.   if$
  887.   new.block
  888.   note output
  889.   fin.entry
  890. }
  891.  
  892. FUNCTION {mastersthesis}
  893. { output.bibitem
  894.   list.label.output
  895.   " (" list.year * ")" * output.yearnull
  896.   author "author" item.check
  897.   title.field field.used =
  898.     { skip$ }
  899.     { format.title "title" output.check }
  900.   if$
  901.   "Master's thesis" format.thesis.type output.nonnull
  902.   school "school" output.check
  903.   address output
  904.   new.block
  905.   note output
  906.   fin.entry
  907. }
  908.  
  909. FUNCTION {misc}
  910. { output.bibitem
  911.   list.label.output
  912.   " (" list.year * ")" * output.yearnull
  913.   title.field field.used =
  914.     { skip$ }
  915.     { format.title quote output }
  916.   if$
  917.   howpublished output
  918.   new.block
  919.   note output
  920.   fin.entry
  921.   empty.misc.check
  922. }
  923.  
  924. FUNCTION {phdthesis}
  925. { output.bibitem
  926.   list.label.output
  927.   " (" list.year * ")" * output.yearnull
  928.   author "author" item.check
  929.   title.field field.used =
  930.     { skip$ }
  931.     { title "title" output.check }
  932.   if$
  933.   "PhD thesis" format.thesis.type output.nonnull
  934.   school "school" output.check
  935.   address output
  936.   new.block
  937.   note output
  938.   fin.entry
  939. }
  940.  
  941. FUNCTION {proceedings}
  942. { output.bibitem
  943.   list.label.output
  944.   " (" list.year * ")" * output.yearnull
  945.   title.field field.used =
  946.     { skip$ }
  947.     { format.btitle "title" output.check }
  948.   if$
  949.   format.bvolume output
  950.   format.number.series output
  951.   address empty$
  952.     { editor empty$
  953.     { skip$ }
  954.     { organization output
  955.     }
  956.       if$
  957.       publisher output
  958.     }
  959.     { editor empty$
  960.     'skip$
  961.     { organization output }
  962.       if$
  963.       publisher output
  964.       address output.nonnull
  965.     }
  966.   if$
  967.   new.block
  968.   note output
  969.   fin.entry
  970. }
  971.  
  972. FUNCTION {techreport}
  973. { output.bibitem
  974.   list.label.output
  975.   " (" list.year * ")" * output.yearnull
  976.   author "author" item.check
  977.   title.field field.used =
  978.     { skip$ }
  979.     { format.title "title" output.check }
  980.   if$
  981.   format.tr.number output.nonnull
  982.   institution "institution" output.check
  983.   address output
  984.   new.block
  985.   note output
  986.   fin.entry
  987. }
  988.  
  989. FUNCTION {unpublished}
  990. { output.bibitem
  991.   list.label.output
  992.   " (" list.year * ")" * output.yearnull
  993.   author "author" item.check
  994.   title.field field.used =
  995.     { skip$ }
  996.     { format.title "title" output.check }
  997.   if$
  998.   note "note" output.check
  999.   fin.entry
  1000. }
  1001.  
  1002. FUNCTION {default.type} { misc }
  1003.  
  1004. MACRO {jan} {"January"}
  1005.  
  1006. MACRO {feb} {"February"}
  1007.  
  1008. MACRO {mar} {"March"}
  1009.  
  1010. MACRO {apr} {"April"}
  1011.  
  1012. MACRO {may} {"May"}
  1013.  
  1014. MACRO {jun} {"June"}
  1015.  
  1016. MACRO {jul} {"July"}
  1017.  
  1018. MACRO {aug} {"August"}
  1019.  
  1020. MACRO {sep} {"September"}
  1021.  
  1022. MACRO {oct} {"October"}
  1023.  
  1024. MACRO {nov} {"November"}
  1025.  
  1026. MACRO {dec} {"December"}
  1027.  
  1028. MACRO {acmcs} {"ACM Computing Surveys"}
  1029.  
  1030. MACRO {acta} {"Acta Informatica"}
  1031.  
  1032. MACRO {cacm} {"Communications of the ACM"}
  1033.  
  1034. MACRO {ibmjrd} {"IBM Journal of Research and Development"}
  1035.  
  1036. MACRO {ibmsj} {"IBM Systems Journal"}
  1037.  
  1038. MACRO {ieeese} {"IEEE Transactions on Software Engineering"}
  1039.  
  1040. MACRO {ieeetc} {"IEEE Transactions on Computers"}
  1041.  
  1042. MACRO {ieeetcad}
  1043.  {"IEEE Transactions on Computer-Aided Design of Integrated Circuits"}
  1044.  
  1045. MACRO {ipl} {"Information Processing Letters"}
  1046.  
  1047. MACRO {jacm} {"Journal of the ACM"}
  1048.  
  1049. MACRO {jcss} {"Journal of Computer and System Sciences"}
  1050.  
  1051. MACRO {scp} {"Science of Computer Programming"}
  1052.  
  1053. MACRO {sicomp} {"SIAM Journal on Computing"}
  1054.  
  1055. MACRO {tocs} {"ACM Transactions on Computer Systems"}
  1056.  
  1057. MACRO {tods} {"ACM Transactions on Database Systems"}
  1058.  
  1059. MACRO {tog} {"ACM Transactions on Graphics"}
  1060.  
  1061. MACRO {toms} {"ACM Transactions on Mathematical Software"}
  1062.  
  1063. MACRO {toois} {"ACM Transactions on Office Information Systems"}
  1064.  
  1065. MACRO {toplas} {"ACM Transactions on Programming Languages and Systems"}
  1066.  
  1067. MACRO {tcs} {"Theoretical Computer Science"}
  1068.  
  1069. READ
  1070.  
  1071. EXECUTE {init.field.constants}
  1072.  
  1073. FUNCTION {sortify}
  1074. { purify$
  1075.   "l" change.case$
  1076. }
  1077.  
  1078. FUNCTION {author.key.label}
  1079. { author empty$
  1080.     { key empty$
  1081.     { title.field 'field.used := }
  1082.     { key.field 'field.used := }
  1083.       if$
  1084.     }
  1085.     { author.field 'field.used := }
  1086.   if$
  1087. }
  1088.  
  1089. FUNCTION {author.editor.key.label}
  1090. { author empty$
  1091.     { editor empty$
  1092.     { key empty$
  1093.         { title.field 'field.used := }
  1094.         { key.field 'field.used := }
  1095.       if$
  1096.       }
  1097.     { editor.field 'field.used := }
  1098.       if$
  1099.     }
  1100.     { author.field 'field.used := }
  1101.   if$
  1102. }
  1103.  
  1104. FUNCTION {author.key.organization.label}
  1105. { author empty$
  1106.     { key empty$
  1107.     { organization empty$
  1108.         { title.field 'field.used := }
  1109.         { organization.field 'field.used := }
  1110.       if$
  1111.     }
  1112.     { key.field 'field.used := }
  1113.       if$
  1114.     }
  1115.     { author.field 'field.used := }
  1116.   if$
  1117. }
  1118.  
  1119. FUNCTION {editor.key.organization.label}
  1120. { editor empty$
  1121.     { key empty$
  1122.     { organization empty$
  1123.         { title.field 'field.used := }
  1124.         { organization.field 'field.used := }
  1125.       if$
  1126.     }
  1127.     { key.field 'field.used := }
  1128.       if$
  1129.     }
  1130.     { editor.field 'field.used := }
  1131.   if$
  1132. }
  1133.  
  1134. FUNCTION {sort.format.title}
  1135. { 't :=
  1136.   "A " #2
  1137.     "An " #3
  1138.       "The " #4 t chop.word
  1139.     chop.word
  1140.   chop.word
  1141.   sortify
  1142.   #1 global.max$ substring$
  1143. }
  1144.  
  1145. FUNCTION {calc.label}
  1146. { type$ "book" =
  1147.   type$ "inbook" =
  1148.   or
  1149.     'author.editor.key.label
  1150.     { type$ "proceedings" =
  1151.     'editor.key.organization.label
  1152.     { type$ "manual" =
  1153.         'author.key.organization.label
  1154.         'author.key.label
  1155.       if$
  1156.     }
  1157.       if$
  1158.     }
  1159.   if$
  1160.   make.abbr.label
  1161.   title.field field.used =
  1162.     { sort.format.title }
  1163.     { sortify }
  1164.   if$
  1165.   year field.or.null purify$ #-1 #4 substring$ sortify
  1166.   *
  1167.   'sort.label :=
  1168. }
  1169.  
  1170. FUNCTION {first.presort}
  1171. { calc.label
  1172.   sort.label
  1173.   title.field field.used =
  1174.     { skip$ }
  1175.     { "    "
  1176.       *
  1177.       make.list.label sortify
  1178.       *
  1179.       "    "
  1180.       *
  1181.       title field.or.null
  1182.       sort.format.title
  1183.       *
  1184.     }
  1185.   if$
  1186.   #1 entry.max$ substring$
  1187.   'sort.key$ :=
  1188. }
  1189.  
  1190. ITERATE {first.presort}
  1191.  
  1192. SORT
  1193.  
  1194. STRINGS { last.sort.label next.extra }
  1195.  
  1196. INTEGERS { last.extra.num }
  1197.  
  1198. FUNCTION {initialize.last.extra.num}
  1199. { #0 int.to.chr$ 'last.sort.label :=
  1200.   "" 'next.extra :=
  1201.   #0 'last.extra.num :=
  1202. }
  1203.  
  1204. FUNCTION {forward.pass}
  1205. { last.sort.label sort.label =
  1206.     { last.extra.num #1 + 'last.extra.num :=
  1207.       last.extra.num int.to.chr$ 'extra.label :=
  1208.     }
  1209.     { "a" chr.to.int$ 'last.extra.num :=
  1210.       "" 'extra.label :=
  1211.       sort.label 'last.sort.label :=
  1212.     }
  1213.   if$
  1214. }
  1215.  
  1216. FUNCTION {reverse.pass}
  1217. { next.extra "b" =
  1218.     { "a" 'extra.label := }
  1219.     'skip$
  1220.   if$
  1221.   year empty$
  1222.     { "n.d." extra.label emphasize * 'list.year := }
  1223.     { year extra.label emphasize * 'list.year := }
  1224.   if$
  1225.   extra.label 'next.extra :=
  1226. }
  1227.  
  1228. EXECUTE {initialize.last.extra.num}
  1229.  
  1230. ITERATE {forward.pass}
  1231.  
  1232. REVERSE {reverse.pass}
  1233.  
  1234. FUNCTION {second.presort}
  1235. { make.list.label
  1236.   title.field field.used =
  1237.     { sort.format.title }
  1238.     { sortify }
  1239.   if$
  1240.   "    "
  1241.   *
  1242.   list.year field.or.null sortify
  1243.   *
  1244.   "    "
  1245.   *
  1246.   title.field field.used =
  1247.     { skip$ }
  1248.     { title field.or.null
  1249.       sort.format.title
  1250.       *
  1251.     }
  1252.   if$
  1253.   #1 entry.max$ substring$
  1254.   'sort.key$ :=
  1255. }
  1256.  
  1257. ITERATE {second.presort}
  1258.  
  1259. SORT
  1260.  
  1261. FUNCTION {begin.bib}
  1262. { preamble$ empty$
  1263.     'skip$
  1264.     { preamble$ write$ newline$ }
  1265.   if$
  1266.   "\begin{thebibliography}{xx}" write$ newline$
  1267. }
  1268.  
  1269. EXECUTE {begin.bib}
  1270.  
  1271. EXECUTE {init.state.consts}
  1272.  
  1273. ITERATE {call.type$}
  1274.  
  1275. FUNCTION {end.bib}
  1276. { newline$
  1277.   "\end{thebibliography}" write$ newline$
  1278. }
  1279.  
  1280. EXECUTE {end.bib}
  1281.